import 'package:flutter/material.dart';
import 'package:flutter_eve_plugin/constants/font_family.dart';
import 'package:flutter_eve_plugin/constants/font_weight.dart';
import 'package:flutter_eve_plugin/utils/image_util.dart';
import 'package:flutter_eve_plugin/utils/screen_util.dart';

class ArchivesGetDialogContentWidget extends StatelessWidget {
  const ArchivesGetDialogContentWidget({
    Key key,
  }) : super(key: key);

  List<Widget> createItem(int len) {
    return List<Widget>.generate(len, (index) {
      return GestureDetector(
        onTap: () {},
        child: Container(
          width: setRatio(125),
          height: setRatio(25),
          margin: EdgeInsets.only(bottom: setRatio(15)),
          decoration: BoxDecoration(
              image: DecorationImage(
                  image: index == 3
                      ? AssetImage(imageUtilYeXiu(
                          'archives/icon_archivers_dialog_item_bg_w@3x'))
                      : AssetImage(imageUtilYeXiu(
                          'archives/icon_archivers_dialog_item_bg@3x')))),
          child: Center(
            child: Text(
              '商店购买',
              style: TextStyle(
                  color: index == 3 ? Color(0xFFFFFFFF) : Color(0xFFD6D8EB),
                  fontFamily: FontFamily.PINGFANG,
                  fontWeight: FontWeightCustom.PF_Medium,
                  fontSize: setTextSp(12)),
            ),
          ),
        ),
      );
    }).toList();
  }

  @override
  Widget build(BuildContext context) {
    return Row(
      mainAxisAlignment: MainAxisAlignment.spaceBetween,
      crossAxisAlignment: CrossAxisAlignment.center,
      children: <Widget>[
        Column(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: <Widget>[
            Container(
              width: setRatio(50),
              height: setRatio(50),
              child: Stack(
                children: <Widget>[
                  Container(
                    decoration: BoxDecoration(
                        image: DecorationImage(
                            image: NetworkImage(
                                'http://pic5.nipic.com/20100106/17596_131212086561_2.jpg')),
                        borderRadius: BorderRadius.circular(setRatio(2))),
                  ),
                  Positioned(
                    bottom: 0,
                    child: Container(
                      height: setRatio(13),
                      width: setRatio(50),
                      decoration: BoxDecoration(
                          color: Color(0x9F000000),
                          borderRadius: BorderRadius.only(
                              bottomLeft: Radius.circular(setRatio(2)),
                              bottomRight: Radius.circular(setRatio(2)))),
                      child: Center(
                        child: Text(
                          '54/30',
                          style: TextStyle(
                              decoration: TextDecoration.none,
                              color: Color(0xFFFFFFFF),
                              fontFamily: FontFamily.PINGFANG,
                              fontWeight: FontWeightCustom.PF_Medium,
                              fontSize: setTextSp(9)),
                        ),
                      ),
                    ),
                  )
                ],
              ),
            ),
            SizedBox(height: setRatio(5)),
            Text(
              '鬼剑士·蒙那',
              maxLines: 1,
              overflow: TextOverflow.ellipsis,
              style: TextStyle(
                  decoration: TextDecoration.none,
                  color: Color(0xFFEFF0F8),
                  fontFamily: FontFamily.PINGFANG,
                  fontWeight: FontWeightCustom.PF_Medium,
                  fontSize: setTextSp(10)),
            ),
            SizedBox(
              height: setRatio(10),
            ),
            SizedBox(
              width: setRatio(100),
              child: Text(
                '用来恩恩嫩嗯嗯嗯呃嗯呢嫩恩恩额饿额么描述描述...',
                maxLines: 4,
                overflow: TextOverflow.ellipsis,
                style: TextStyle(
                    color: Color(0xFFE0E2F0),
                    fontFamily: FontFamily.PINGFANG,
                    fontWeight: FontWeightCustom.PF_Medium,
                    fontSize: setTextSp(9)),
              ),
            )
          ],
        ),
        Column(
          mainAxisAlignment: MainAxisAlignment.start,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: createItem(4),
        )
      ],
    );
  }
}
